package com.maistars.spider.repository.dao;

import com.maistars.spider.common.exception.TopicSpiderException;
import com.maistars.spider.repository.model.CrawlerFieldRulePO;
import com.maistars.spider.repository.model.CrawlerPageRulePO;
import com.maistars.spider.repository.model.CrawlerSiteRulePO;
import com.maistars.spider.repository.model.CrawlerTaskPO;

import java.util.List;

/**
 * @author dhr
 * @date 2021/10/1 下午11:45
 */
public interface CrawlerTaskDao {

    void createCrawlerTask(CrawlerTaskPO crawlerTaskPO) throws TopicSpiderException;

    void createCrawlerSiteRule(CrawlerSiteRulePO crawlerSiteRulePO) throws TopicSpiderException;

    void createCrawlerPageRule(CrawlerPageRulePO crawlerPageRulePO) throws TopicSpiderException;

    void createCrawlerFieldRule(CrawlerFieldRulePO crawlerFieldRulePO) throws TopicSpiderException;

    void updateCrawlerTask(CrawlerTaskPO crawlerTaskPO) throws TopicSpiderException;

    void updateCrawlerSiteRule(CrawlerSiteRulePO crawlerSiteRulePO) throws TopicSpiderException;

    void updateCrawlerPageRule(CrawlerPageRulePO crawlerPageRulePO) throws TopicSpiderException;

    void updateCrawlerFieldRule(CrawlerFieldRulePO crawlerFieldRulePO) throws TopicSpiderException;

    CrawlerTaskPO getCrawlerTask(Integer taskId) throws TopicSpiderException;

    CrawlerPageRulePO getCrawlerPageRule(Integer pageRuleId) throws TopicSpiderException;

    CrawlerSiteRulePO getCrawlerSiteRule(Integer siteRuleId) throws TopicSpiderException;

    List<CrawlerTaskPO> listCrawlerTasks() throws TopicSpiderException;

    List<CrawlerSiteRulePO> listCrawlerSiteRules(Integer taskId) throws TopicSpiderException;

    CrawlerFieldRulePO getCrawlerFieldRule(Integer fieldRule) throws TopicSpiderException;

    CrawlerFieldRulePO getCrawlerFieldRuleByName(String fieldName,Integer pageRuleId) throws TopicSpiderException;

    List<CrawlerPageRulePO> listCrawlerPageRules(Integer taskId) throws TopicSpiderException;

    List<CrawlerFieldRulePO> listCrawlerFieldRules(Integer pageRuleId) throws TopicSpiderException;
}
